package com.caowei.weicimpress.weicimpress.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by caoweiPc on 2014/7/20.
 */
public class MyListView extends ListView {
    private List<CallBack> callBacks=new ArrayList<CallBack>();
    private final static String TAG=ListViewRightLayout.class.getSimpleName();
    public MyListView(Context context) {
        super(context);
    }

    public MyListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyListView(Context context, AttributeSet attrs, int defStyle) {
        super( context,  attrs,  defStyle );
    }


    public void addCallback(CallBack callBack){
        callBacks.add(callBack);
    }

    public void cancleAllSelectedCheckbox(){
         for(CallBack callBack:callBacks){
             if(CancleSelectedCheckbox.class.isAssignableFrom(callBack.getClass())){
                 callBack.callBack();
                 break;
             }
         }
    }

    public static interface CallBack{
        public void callBack();
    }

    public static interface CancleSelectedCheckbox extends CallBack{

    }
}
